<script>
    /*设置列表数据*/
    function setListData(curPageData, isAppend,isMenu=true) {
        var listDom=document.getElementById("newsList");
        if(isAppend) {
            for (var i = 0; i < curPageData.length; i++) {
                var newObj=curPageData[i];
                var str = `
						<div class="tourInfor">
							<div class="tourImg">
								<a href= "{php echo '/'.createMobileUrl('main',array('mod'=>'userdata','themeid'=>$themeid,'op'=>'user_log_list'));}&uid=${newObj.uid}">
							    	<img src="${newObj.user_avater}" onerror="javascript:this.src='https://css2020.yixuan.net/2020css/yx2020/images/question.png';">
								</a>
							</div>
							<div class="tourTxt">
								<h2> ${newObj.user_nickname}</h2>
								<p>${newObj.user_username} ${ newObj.user_mobile ? `${newObj.user_mobile}<a href="tel:${newObj.user_mobile}" class="telEnter"></a>` : "" }</p>
							</div>
							<div class="tourEnter">
								<span>${newObj.type_name} ${newObj.show_visit ==1 ? `${newObj.standing_time&&newObj.standing_time>0 ?`(<i style="color: #bf352c">${newObj.standing_time}'s</i>)`:''}`  :''}</span>
								<p>第${newObj.type_num?newObj.type_num:0}次${newObj.show_visit ==1 ?`访问`:''}</p>
							</div>
						</div>
                        <div class="workerInfor">`;
                if (newObj.from_uid!=0){
                    str += `<div class="worker clearfix">
								<div class="workerImg">
									<img src="${newObj.fromuser_avater}" onerror="javascript:this.src='https://css2020.yixuan.net/2020css/yx2020/images/question.png';">
									${newObj.is_work ==1 ? `<span>员工</span>`:''}
								</div>
								<div class="workerTxt">
									<h2><i>${ newObj.fromuser_nickname} </i><span style="background:${newObj.link_color}"> ${newObj.link_name }</span></h2>
									<p> ${newObj.worker ? `员工：${newObj.worker}` : ''}</p>
								</div>
							</div>`;
                }
                str += `
                            ${newObj.from_uid==0&&newObj.show_visit ==1? `<div class="frhelp"  style="background:${newObj.link_color}"> ${newObj.link_name }</div>`:''}
                            ${newObj.remark ? `  <div class="frhelp">${newObj.remark}</div>`:''}
							<div class="timesControl clearfix">
								<p>${newObj.create_time}</p>
								<span>${newObj.time_span}</span>

								<div class="controlBar">
									<div class="controlList">
										<a class="dateli" href="{php echo '/'.createMobileUrl('main',array('mod'=>'userdata','themeid'=>$themeid,'op'=>'user_log_list'));}&uid=${newObj.uid}" >详情</a>
										<a href="{php echo '/'.createMobileUrl('main',array('mod'=>'userdata','themeid'=>$themeid,'op'=>'user_trace_list'));}&uid=${newObj.uid}" class="fllow">追踪</a>
<!--										<a href="" class="shion">关系</a>-->
									</div>
									  ${isMenu? `<i></i>`:''}
								</div>
							</div>
						</div>
						<div class='workerTag' style="min-height:.8rem">
							 ${newObj.sign_type >0 ? `<span class="${ newObj.sign_type == 1 ? 'unlabeledTag' : newObj.sign_type == 2 ? 'flowTag' : newObj.sign_type == 3 ? 'markTag' :'payTag'  }">${newObj.sign_name}</span>`:' <span></span>'}
							 ${newObj.is_pay ==1?`<span class="${newObj.pay_class}">${newObj.pay_txt}</span>`:'<span></span>'}
						</div>
						`
                var liDom=document.createElement("li");
                liDom.innerHTML=str;
                listDom.appendChild(liDom);//加在列表的后面,上拉加载
                // if (isAppend) {
                //     listDom.appendChild(liDom);//加在列表的后面,上拉加载
                // } else{
                //     listDom.insertBefore(liDom, listDom.firstChild);//加在列表的前面,下拉刷新
                // }
            }
        } else {
            listDom.innerHTML = '';
            for (var i = curPageData.length-1; i >= 0; i--) {
                var newObj=curPageData[i];
                var str = `
						<div class="tourInfor">
							<div class="tourImg">
								<a href= "{php echo '/'.createMobileUrl('main',array('mod'=>'userdata','themeid'=>$themeid,'op'=>'user_log_list'));}&uid=${newObj.uid}">
							    	<img src="${newObj.user_avater}" onerror="javascript:this.src='https://css2020.yixuan.net/2020css/yx2020/images/question.png';">
								</a>
							</div>
							<div class="tourTxt">
								<h2> ${newObj.user_nickname}</h2>
								<p>${newObj.user_username} ${ newObj.user_mobile ? `${newObj.user_mobile}<a href="tel:${newObj.user_mobile}" class="telEnter"></a>` : "" }</p>
							</div>
							<div class="tourEnter">
								<span>${newObj.type_name} ${newObj.show_visit ==1 ? `${newObj.standing_time&&newObj.standing_time>0 ?`(<i style="color: #bf352c">${newObj.standing_time}'s</i>)`:''}`  :''}</span>
								<p>第${newObj.type_num?newObj.type_num:0}次${newObj.show_visit ==1 ?`访问`:''}</p>
							</div>
						</div>
                        <div class="workerInfor">`;
                if (newObj.from_uid!=0){
                    str += `<div class="worker clearfix">
								<div class="workerImg">
									<img src="${newObj.fromuser_avater}" onerror="javascript:this.src='https://css2020.yixuan.net/2020css/yx2020/images/question.png';">
									${newObj.is_work ==1 ? `<span>员工</span>`:''}
								</div>
								<div class="workerTxt">
									<h2><i>${ newObj.fromuser_nickname} </i><span style="background:${newObj.link_color}"> ${newObj.link_name }</span></h2>
									<p> ${newObj.worker ? `员工：${newObj.worker}` : ''}</p>
								</div>
							</div>`;
                }
                str += `
                            ${newObj.from_uid==0&&newObj.show_visit ==1? `<div class="frhelp"  style="background:${newObj.link_color}"> ${newObj.link_name }</div>`:''}
                            ${newObj.remark ? `  <div class="frhelp">${newObj.remark}</div>`:''}
							<div class="timesControl clearfix">
								<p>${newObj.create_time}</p>
								<span>${newObj.time_span}</span>

								<div class="controlBar">
									<div class="controlList">
										<a class="dateli" href="{php echo '/'.createMobileUrl('main',array('mod'=>'userdata','themeid'=>$themeid,'op'=>'user_log_list'));}&uid=${newObj.uid}" >详情</a>
										<a href="{php echo '/'.createMobileUrl('main',array('mod'=>'userdata','themeid'=>$themeid,'op'=>'user_trace_list'));}&uid=${newObj.uid}" class="fllow">追踪</a>
<!--										<a href="" class="shion">关系</a>-->
									</div>
									  ${isMenu? `<i></i>`:''}
								</div>
							</div>
						</div>
						<div class='workerTag' style="min-height:.8rem">
							 ${newObj.sign_type >0 ? `<span class="${ newObj.sign_type == 1 ? 'unlabeledTag' : newObj.sign_type == 2 ? 'flowTag' : newObj.sign_type == 3 ? 'markTag' :'payTag'  }">${newObj.sign_name}</span>`:' <span></span>'}
							 ${newObj.is_pay ==1?`<span class="${newObj.pay_class}">${newObj.pay_txt}</span>`:'<span></span>'}
						</div>
						`
                var liDom=document.createElement("li");
                liDom.innerHTML=str;
                listDom.insertBefore(liDom, listDom.firstChild);//加在列表的前面,下拉刷新
                // if (isAppend) {
                //     listDom.appendChild(liDom);//加在列表的后面,上拉加载
                // } else{
                //     listDom.insertBefore(liDom, listDom.firstChild);//加在列表的前面,下拉刷新
                // }
            }
        }

    }
</script>